# Instructions for Replication

## Data
The following data sets include original experimental data, from the learning and evaluation stages of the study. 
   - `clean_learning_concerns_data.rds`: Survey data from Facebook Messenger conversations in the study learning stage, organized by unique user concern
     - Codebook: `codebook_concerns.pdf`
   - `clean_evaluation_data.rds`: Survey data from Facebook Messenger conversations in the study evaluation stage, organized by unique user
     - Codebook: `codebook_eval.pdf`
   - `clean_vaxintake_data.csv`: Survey intake data on vaccination rates
     - Codebook: `codebook_vaxintake.pdf`

Download and unzip the following files to generate maps for the supplementary appendix:
- `nga_adm_osgof_20190417.zip`: Nigeria administrative boundary data
  - [data.humdata.org/dataset/cod-ab-nga?](https://data.humdata.org/dataset/cod-ab-nga?)
- `gadm36_KEN_shp.zip`: Kenya administrative boundary data
  - [gadm.org/download_country_v3.html](https://gadm.org/download_country_v3.html) -> select Kenya -> Shapefile

Download Afrobarometer data for demographic comparison in the supplementary appendix:
- `afrobarometer_kenya_2019.sav`: 2019 Kenya Afrobarometer data
  - [https://www.afrobarometer.org/survey-resource/kenya-round-8-data-2019/](https://www.afrobarometer.org/survey-resource/kenya-round-8-data-2019/)
- `afrobarometer_nigeria_2021.sav`: 2021 Nigeria Afrobarometer data
  -  [https://www.afrobarometer.org/survey-resource/nigeria-round-8-data-2021/](https://www.afrobarometer.org/survey-resource/nigeria-round-8-data-2021/)

## Analysis

The analysis is extracted from an Sweave file produced for the paper and separately for the supplementary information. 
Compile the following scripts in sequence:
  - `chatbot_paper.R`: Analysis in main paper
  - `chatbot_SI.R`: Analysis in supplementary appendix

Supporting functions:
  - utils.R

## Additional information

Code run on
- Mac operating system
- R version 4.3.1 (2023-06-16).
- Platform: aarch64-apple-darwin20 (64-bit)(America/Argentina/Buenos_Aires)

Package requirements are described in `requirements.txt`
